import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { IMessageHandle } from "../../../../extensions/phoenix-plugin-client/assets/core/interface/IMessageHandle";
import messageManager from "../../../../extensions/phoenix-plugin-client/assets/core/managers/message.manager";
import { GameEvent } from "../../common/event/GameEvent";
import { OpcodeApp } from "../define/opcode.define";
import * as proto from "../protoc/ts/proto_app.js";

export default class S2CGetRoomPmt implements IMessageHandle{
    handleMessage(msgData: any): void {
        let response = msgData as proto.s2c_GetRoomPmtInfo;
        console.log("S2CGetRoomPmt", response);
        oops.message.dispatchEvent(GameEvent.GetRoomPmtInfo, response.roomPmtInfo);
    }
}

messageManager.registerHandle(OpcodeApp.Opcode_SC_GET_ROOM_PMT, new S2CGetRoomPmt());